import 'package:logger/logger.dart';

class Log {
  static final Logger _logger = Logger(printer: PrettyPrinter(methodCount: 0));

  static get logger => _logger;

  static bool isDebug = false;

  static t(dynamic message, [Object? error, StackTrace? stackTrace]) {
    if (isDebug) {
      _logger.t(message, error: error, stackTrace: stackTrace);
    }
  }

  static d(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    if (isDebug) {
      _logger.d(message, error: error, stackTrace: stackTrace);
    }
  }

  static i(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    if (isDebug) {
      _logger.i(message, error: error, stackTrace: stackTrace);
    }
  }

  static w(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    if (isDebug) {
      _logger.w(message, error: error, stackTrace: stackTrace);
    }
  }

  static e(dynamic message, [dynamic error, StackTrace? stackTrace]) {
    if (isDebug) {
      _logger.e(message, error: error, stackTrace: stackTrace);
    }
  }
}
